package schoolDemo3;

class CyLinder7_7{
    private double radius;
    private int height;
    private double pi=3.14;
    String color;
    double area(){ return pi*radius*radius;}
    double volume(){ return area()*height;}
    private CyLinder7_7(){
        System.out.println("无参数的构造方法被调用了！");
    }
    public CyLinder7_7(double r,int h,String c){
        this();
        System.out.println("有参构造方法被调用了！");
        radius = r;
        height=h;
        color=c;
    }
    public void show(){
        System.out.println("圆柱底半径为："+radius);
        System.out.println("圆柱体的高是："+height);
        System.out.println("圆柱的颜色为："+color);
        System.out.println("圆柱底面积为："+area());
        System.out.println("圆柱体积为："+volume());
    }
}
public class App7_7 {
    public static void main(String[] args) {
        new CyLinder7_7(10,5,"金色").show();
    }
}
